#include <iostream>

using namespace std;

int main() {
    //加减乘除运算
    int num1 = 10;
    int num2 = 3;
    cout << num1 + num2 << endl;
    cout << num1 - num2 << endl;
    cout << num1 * num2 << endl;
    cout << num1 / num2 << endl;//两个整数相除结果依然是整数，将小数部分去除
    float num3 = 0.5;
    float num4 = 0.22;
    cout << num3 / num4 << endl;//两个小数可以相除，运算结果为小数
    cout << "---------" << endl;

    //取模运算(取余运算)
    //本质:求余数
    cout << num1 % num2 << endl;
    //cout << num3 % num4 << endl;//两个小数不可以取余运算

    //自增自减
    //前置自增自减先让变量+1或-1 然后进行表达式运算
    //后置自增自减先进行表达式运算 后让变量+1或-1
    int a=2;
    int b;
    //前置
    b=++a;
    cout<<"a="<<a<<" "<<"b="<<b<<endl;
    a=2;
    b=--a;
    cout<<"a="<<a<<" "<<"b="<<b<<endl;
    //后置
    a=2;
    b=a++;
    cout<<"a="<<a<<" "<<"b="<<b<<endl;
    a=2;
    b=a--;
    cout<<"a="<<a<<" "<<"b="<<b<<endl;
    return 0;
}